package appconfig

import (
	"github.com/spf13/viper"
	"log"
)

type AppConfig struct {
	Mysql
	Redis
	AthRealname
}
type Mysql struct {
	Host     string
	Pose     int
	User     string
	Password string
	DB       string
}

type Redis struct {
	Addr     string
	Password string
	DB       int
}

type AthRealname struct {
	SecretID  string
	SecretKey string
}

var AppConf AppConfig

func Init() {
	viper.SetConfigFile("../user_srv/appconfig/dev.yaml")
	viper.ReadInConfig()
	viper.Unmarshal(&AppConf)

	log.Println("动态配置:", &AppConf)
}
